package com.liu.stockmarket.repository.database.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.liu.stockmarket.repository.database.entity.ProfitEntity
import java.time.LocalDate

@Dao
interface ProfitDao {
    @Insert
    suspend fun save(profitEntity: ProfitEntity)

    @Query(value = "delete from profit where date =:date")
    suspend fun deleteByDate(date: LocalDate)

    @Insert
    suspend fun save(profitEntitys: List<ProfitEntity>)

    @Query("select * from profit")
    suspend fun queryAll(): List<ProfitEntity>

    @Query("delete from profit")
    suspend fun deleteAll()
}